package com.qyer.lxp.common.framework.exception;

import com.qyer.lxp.common.framework.contants.ErrorMessageEnum;
import com.qyer.lxp.common.framework.util.XMLReader;

/**
 * 异常统一处理类
 * Created by jiangping on 16/5/16.
 */
public class QyerException extends Exception{

    /**
     * 错误码
     */
    private String errorCode;

    /**
     * 错误消息
     */
    private String errorMessage;

    public QyerException(Throwable e){
        super(e);
    }

    public QyerException(String code){
        super(ErrorMessageEnum.getErrorMessage(code));
        this.errorCode = code;
        this.errorMessage = ErrorMessageEnum.getErrorMessage(code);
    }

    public QyerException(String code, String message){
        super(message);
        this.errorCode = code;
        this.errorMessage = message;
    }

    public String getErrorCode() {
        return errorCode;
    }

    public String getErrorMessage() {
        return errorMessage;
    }
}
